<?php $this->load->view('common/head');?>

<?php $this->load->view('common/header');?>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <?php $this->load->view('common/sidebar');?>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <?php $this->load->view('common/breadcrumbs');?>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">

                <?php $this->load->view('common/set');?>
                <div class="row">
                    <div class="col-sm-22 widget-container-col ui-sortable" id="widget-container-col-10">
                        <div class="widget-box ui-sortable-handle" id="widget-box-10">
                            <div class="widget-header widget-header-small">
                                <h5 class="widget-title smaller">实名认证</h5>
                            </div>

                            <div class="widget-body">
                                <div class="widget-main" style="padding: 30px;">
                                    <div class="tab-content">
                                        <div id="picture" class="tab-pane active">
                                            <form class="form-horizontal" action="<?php echo site_url(X_URL.'goods/pics_set');?>" method="post" id="form4">
                                                <input type="hidden" id="uid" name="uid" value="<?php if(!empty($uid)){  echo $uid;}?>">

                                                <div class="space-4"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-1 control-label no-padding-right" for="form-field-4">
                                                        认证图片 </label>
                                                    <div class="col-sm-9">
                                                        <div class="file-loading">
                                                            <input id="kv-explorer"  name="pic[]" type="file" accept="image/*" multiple>
                                                        </div>
                                                    </div>
                                                </div>
                                            </form>
                                        </div>
                                        <?php if($member['user_card_rz'] == 1){?>
                                        <div class="col-md-offset-2 col-md-9">
                                            <span class="btn btn-purple btn-sm rz_user_pass" action="2">
                                                <span class=" icon-on-right bigger-110"></span>
                                            认证通过
                                            </span>

                                            &nbsp; &nbsp; &nbsp;
                                            <span class="btn btn-purple btn-sm rz_user_pass" action="3">
                                                <span class=" icon-on-right bigger-110"></span>
                                            拒绝
                                            </span>
                                        </div>
                                        <?php } ?>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
                <!-- /section:settings.box -->
                <div class="row">

                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <?php $this->load->view('common/footer');?>
</div><!-- /.main-container -->

<?php $this->load->view('common/footerjs');?>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(function () {
        var picpath = <?php echo $pic_path;?>;
        var piccon = <?php echo $pic_con;?>;
        $(document).ready(function () {
            $("#kv-explorer").fileinput({
                language: 'zh',
                uploadAsync: false, //设置上传同步异步 此为同步
                dropZoneEnabled: false,
                showUpload: false, //是否显示上传按钮
                showCaption: false,//是否显示标题
                showRemove:false,
                showBrowse:false,
                'theme': 'explorer-fa',
                'uploadUrl': baseurl+'index.php/manage/pubfun/upload_img?good_id=1&access_key=2222',
                overwriteInitial: false,
                initialPreviewAsData: true,
                initialPreviewFileType: 'image',
                initialPreview:picpath, //要显示的图片的路径
                initialPreviewConfig:piccon
            });
            $("#kv-explorer").on("filebatchuploadsuccess", function (event, data) {
                var rst = data.response;
                var access_key = rst.access_key;
                $("#access_key").val(access_key);
            });

        });

        $(".rz_user_pass").click(function(){
            var uid = $("#uid").val();
            var action = $(this).attr("action");
            var locationurl = baseurl+"index.php/manage/member/rz_user_action";
            $.ajax({
                url:locationurl,
                type:"get",
                data:{'uid':uid,"action":action},
                dataType: 'json',
                success: function(data){
                    console.log(data);
                    if(data.code == 200){
                        layer.msg('认证成功', {
                            time: 1000, //1s后自动关闭
                            shade: 0.1
                        },function () {
                            window.location.href = "<?php echo site_url(X_URL.'member/users');?>";
                        });
                    }else{
                        console.log(data);
                        layer.alert(data.msg);
                    }
                }
            });
        });

    });


</script>
</body>
</html>
